package com.yingxin.yxerp.module.sys.entity.builder;

import cn.hutool.core.bean.BeanUtil;
import com.yingxin.yx.framework.commons.constant.CommonConst;
import com.yingxin.yx.framework.commons.id.IdHelper;
import com.yingxin.yxerp.module.sys.entity.WasteName;
import com.yingxin.yxerp.module.sys.vo.req.WasteNameCreateVo;
import org.apache.commons.lang3.StringUtils;

public class WasteNameBuilder {

    /**
     * 废料名称 构造器
     */
    public static WasteName build(WasteNameCreateVo createVo) {
        WasteName wasteName = new WasteName();
        BeanUtil.copyProperties( createVo, wasteName );
        if( StringUtils.isBlank( wasteName.getId() ) ){
            wasteName.setId( IdHelper.snowflakeId() );
        }
        wasteName.setDelFlag( CommonConst.FALSE );
        return wasteName;
    }

}
